package cn.wolfcode.mapper;

import cn.wolfcode.domain.Role;
import cn.wolfcode.quest.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Role record);

    Role selectByPrimaryKey(Long id);

    List<Role> selectAll();

    int updateByPrimaryKey(Role record);

    int selectForCount(QueryObject qo);

    List<Role> selectForList(QueryObject qo);

    //添加角色-权限关系表数据的方法
    void insertPremission(@Param("role") Role role, @Param("ids") Long[] ids);
    //删除根据角色id删除关系表中原角色的关系
    void deletePremission(Role role);
    /*
          通过员工的id查找该员工的角色
     */
    List<String> selRolesByEmpId(Long id);
}